package LeetCode刷题;

/**
 * @program: Java_Study
 * @author: Xiaofan
 * @createTime: 2021-10-03 14:16
 * @description: Functions of this class is
 **/
public class NoNo动态规划最大乘积子数组 {
    public static void main(String args[]){
    }
    /**
     * 官方题解：
     * 可以根据正负性进行分类讨论。
     *
     * class Solution {
     *     public int maxProduct(int[] nums) {
     *         int maxF = nums[0], minF = nums[0], ans = nums[0];
     *         int length = nums.length;
     *         for (int i = 1; i < length; ++i) {
     *             int mx = maxF, mn = minF;
     *             maxF = Math.max(mx * nums[i], Math.max(nums[i], mn * nums[i]));
     *             minF = Math.min(mn * nums[i], Math.min(nums[i], mx * nums[i]));
     *             ans = Math.max(maxF, ans);
     *         }
     *         return ans;
     *     }
     * }
     */
}